home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
basic
/
qbwinfnt.zip
/
EX_FSTCH.BAS
< prev
next >
Wrap
BASIC Source File
|
1994-03-01
|
2KB
|
61 lines
REM: EX_FSTCH.BAS, Unregistered Version 1.0
REM: Example of using FastChar to display characters.
DECLARE SUB BLOADFont (FlName$, FontArray%(), RetCode%)
DECLARE SUB DispChar (Char%, FClr%, BClr%, X%, Y%, FontArray%())
DECLARE SUB FastChar (Char%, FClr%, X%, Y%, FontArray%())
'...setup a VGA screen mode...
SCREEN 12
'...dimen array for font data (use REDIM so its DYNAMIC)...
REDIM FontArray%(1)
PRINT : PRINT "BLOAD'ing a font from DTCH_BLD.BIN..."
'...load the font in one of the example BIN files...
CALL BLOADFont("DTCH_BLD.BIN", FontArray%(), RetCode%)
'...check return code, catches non-existent file...
IF (RetCode% <> 0) THEN STOP
'...draw A to Z, 25 times using DispChar (fgnd & bgnd)...
Start1 = TIMER
FOR Dupl% = 1 TO 25
X% = 50 + Dupl%: Y% = 60 + Dupl%
FOR Char% = 65 TO 90
CALL DispChar(Char%, 7, 8, X%, Y%, FontArray%())
NEXT Char%
NEXT Dupl%
End1 = TIMER
'...draw A to Z, 25 times using DispChar (fgnd only)...
Start2 = TIMER
FOR Dupl% = 1 TO 25
X% = 50 + Dupl%: Y% = 100 + Dupl%
FOR Char% = 65 TO 90
CALL DispChar(Char%, 7, -1, X%, Y%, FontArray%())
NEXT Char%
NEXT Dupl%
End2 = TIMER
'...display letters A to Z, 25 times using FastChar...
Start3 = TIMER
FOR Dupl% = 1 TO 25
X% = 50 + Dupl%: Y% = 140 + Dupl%
FOR Char% = 65 TO 90
CALL FastChar(Char%, 7, X%, Y%, FontArray%())
NEXT Char%
NEXT Dupl%
End3 = TIMER
'...skip down a ways and print results...
LOCATE 15, 1: PRINT "Approximate times for 25 displays: "
PRINT USING " DispChar (fgnd, bgnd): ##.##"; End1 - Start1
PRINT USING " DispChar (fgnd only): ##.##"; End2 - Start2
PRINT USING " FastChar: ##.##"; End3 - Start3
END